package com.isoft.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * @author LiuGaoMing
 * @version 1.0
 * @description:
 * @date 2024/5/18 11:49
 */
@Controller
public class CSRFController {
//    跳转到用户修改页面
    @GetMapping("toUpdate")
    public String toUpdate()
    {
        return "csrf/csrfTest";
    }
    @ResponseBody
    @PostMapping("/updateUser")
    public String updateUser(@RequestParam String username,
                             @RequestParam String password,
                            HttpServletRequest request){
        String csrf_token = request.getParameter("_csrf");
        return "OK";

    }

}
